Spanish updates from Alberto Nu~nez
[adiumx.git] / Plugins / Purple Service / ESPurpleQQAccount.m
blob344a0966149c9693eaba3b11300aa0ad6eb8aed5
1 //
2 //  ESPurpleQQAccount.m
3 //  Adium
4 //
5 //  Created by Evan Schoenberg on 8/7/06.
6 //
8 #import "ESPurpleQQAccount.h"
11 @implementation ESPurpleQQAccount
13 - (const char*)protocolPlugin
15     return "prpl-qq";
18 - (void)configurePurpleAccount
20         [super configurePurpleAccount];
21         
22         purple_account_set_bool(account, "use_tcp", [[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue]);
25 /*!
26  * @brief The server name to be passed to libpurple
27  * QQ prpl will choose a server randomly for load balancing if we don't pass one, so do that.  -[self host] returns the first server
28  * for host reachability checking purpoes.
29  */
30 - (NSString *)hostForPurple
32         NSString *specifiedHost = [self preferenceForKey:KEY_CONNECT_HOST group:GROUP_ACCOUNT_STATUS];
33         return (specifiedHost ? specifiedHost : nil);                   
36 - (NSString *)host
38 /* This is not technically right, since the qq plugin randomly chooses one of many different servers at connect time.
39  * "sz.tencent.com" or "sz#.tencent.com" for UDP
40  * "tcpconn.tencent.com" or "tcpconn#.tencent.com" where (# <= 6) for TCP.
41  * Specifying the host is important for network reachability checking, though, and generally all hosts should be up if one is reachable.
42  */
43         NSString *host = [self hostForPurple];
44         if (!host)
45                 host = ([[self preferenceForKey:KEY_QQ_USE_TCP group:GROUP_ACCOUNT_STATUS] boolValue] ? @"tcpconn.tencent.com" : @"sz.tencent.com");
46         
47         return host;
50 #pragma mark Account Action Menu Items
51 - (NSString *)titleForAccountActionMenuLabel:(const char *)label
53         if (label && (strcmp(label, _("Modify my information")) == 0)) {
54                 return AILocalizedString(@"Modify My Information", "Menu title for configuring the public information for a QQ account");
55         }
56         
57         return [super titleForAccountActionMenuLabel:label];
60 @end